//
//  HSBasedResponseModel.m
//  HSTS
//
//  Created by simon on 2017/1/24.
//  Copyright © 2017年 simon. All rights reserved.
//

#import "HSBasedResponseModel.h"
#import "SVProgressHUD.h"



@implementation HSBasedResponseModel
-(void)showErrorMsg
{
    if(self.message && self.message.length>0 && ![self.respMsg boolValue]){
        [SVProgressHUD showErrorWithStatus:self.message];
    }
    
}


-(NSDictionary*)getPayloadDictionary
{
    if([self.respInfo isKindOfClass:[NSDictionary class]]){
        NSDictionary *dic = (NSDictionary*)self.respInfo;
        return  dic;
    }else if([self.respInfo isKindOfClass:[NSArray class]]){
        NSDictionary *dic = [NSDictionary dictionaryWithObject:self.respInfo forKey:@"data"];
        return dic;
    }else{
        if (self.respInfo) {
            NSDictionary *dic = [NSDictionary dictionaryWithObject:self.respInfo forKey:@"data"];
            return dic;
        }
    }
    
    return nil;
}


@end
